<template>
  <div :class="[modelName]" >
       <el-card class="box-card" shadow="never">
            <a class="title" href="javascript:void(0);">{{title}}</a>
            <div>
                <p class="content" >
                    <img v-if="img" style="width:120px;max-height:160px;float:right;" :src="img" />
                    {{subcontent}}
                </p>
                
            </div>           
            <div>
                <span><a href="javascript:void(0);">{{author}}</a></span>
                <span><a href="javascript:void(0);">链接1</a></span>
                <span><a href="javascript:void(0);">链接2</a></span>
                <span><a href="javascript:void(0);">链接3</a></span>
            </div>
        </el-card>
  </div>
</template>

<script>
export default {

    data () {
        return {
            'modelName':'item-data',
            'maxLen':100
        }
    },

    props:['title','content','id','author','create-date','img'],
    computed:{
        'subcontent':function(){
            if(!this.content)return '';
            else if(this.content.length >= this.maxLen)return this.content.substr(0,this.maxLen)+"...";
            return this.content;
        }
    },
    mounted(){ this.init(); },

    methods: {
        init(){},
    }
}
</script>

<style>

</style>
